function setTab(name,cursel,n){ 
for(i=1;i<=n;i++){ 
var menu=document.getElementById(name+i); 
var con=document.getElementById("con_"+name+"_"+i); 
menu.className=i==cursel?"hover":""; 
con.style.display=i==cursel?"block":"none"; 
} 
}
function setTabFirst(name,n){
	for(var i=1; i<=n; i++){
	switch(i){
		case 1:document.getElementById(name+i).onclick=function(){ setTab(name,1,n);}; break;
		case 2:document.getElementById(name+i).onclick=function(){ setTab(name,2,n);}; break;
		case 3:document.getElementById(name+i).onclick=function(){ setTab(name,3,n);}; break;
		case 4:document.getElementById(name+i).onclick=function(){ setTab(name,4,n);}; break;
	}//swich end
	}//for end
}


//初始化五个滑动门
window.onload= function(){
	setTabFirst('newly',4);
}

/*  示例结构：newly,4
   <!--Menu Part-->
    <ul class="menubox_newly">
    <li id="newly1" class="hover"><a href="#">潮流服饰</a></li>
    <li id="newly2"><a href="#">家居用品</a></li>
    <li id="newly3"><a href="#">家居用品</a></li>
    <li id="newly4"><a href="#">家居用品</a></li>
    </ul>
  <!--Content Part-->
  <div class="content_newly">
    <div id="con_newly_1">Tabs1</div>
    <div id="con_newly_2">Tabs2</div>
    <div id="con_newly_3">Tabs3</div>
    <div id="con_newly_4">Tabs4</div>
 </div>


*/